/*
 * GUIManager.hpp
 *
 *  Created on: Sep 12, 2013
 *      Author: jason
 */

#ifndef GUIMANAGER_HPP_
#define GUIMANAGER_HPP_

#include <string>
#include <SFML/Graphics.hpp>
#include "../Common.hpp"

namespace OForce_UI {

class MenuWindow {
	friend class GUIManager;
public:
	MenuWindow();
	~MenuWindow();
	void draw();
	void update();
	void selectIcon(int i);
	void highlightIcon(int i) {mHighLightedIcon = i;}
private:
	int mHighlightedIcon;
	int mSelectedIcon;
	// Menus consist of a four by four grid each corresponding to the d-pad
	// TODO preload all textures (main menu, item menus, etc)
	sf::Texture mUp;
	sf::Texture mDown;
	sf::Texture mLeft;
	sf::Texture mRight;
	sf::Sprite  mUpSprite;
	sf::Sprite  mDownSprite;
	sf::Sprite  mLeftSprite;
	sf::Sprite  mRightSprite;
};

class DialogueWindow {
	friend class GUIManager;
public:
	DialogueWindow();
	~DialogueWindow();
	void draw();
	void drawText();
	void update();
	void hurry();
	bool finishedTyping() {return (curTime / endTime) >= 1.0;}
	float getTypingSpeed() {return typingSpeed;}
	void setTypingSpeed(float s) {typingSpeed = s;}
	void setString(std::string text);
private:
	bool mFinished;
	sf::Image mImage;
	sf::Texture mTexture;
	sf::Sprite mSprite;
	std::string mText;
	sf::Text windowText;
	float typingSpeed;
	float curTime;
	float endTime;
};

class GUIManager
{
public:
	GUIManager();
	~GUIManager();
private:

};

} // namespace


#endif /* GUIMANAGER_HPP_ */
